<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title></title>
	</head>
	<body>
		
	</body>
	<script type="text/javascript">
		// 不能修改的量称之为常量
		
		const SCHOOL = "清华";
		
		// 1.必须赋初始值
		// const a;// 报错  Missing initializer in const declaration
		
		// 2.一般常量使用大写(小写也可以)
		// const a = 100;
		// console.log(a);
		
		// 3.常量值不能修改
		// SCHOOL = "北大";	//报错  Assignment to constant variable
		
		// 4.块级作用域
		/* {
			const player = "uzi";
			console.log(player);// uzi
		}
		console.log(player);// 报错  player is not defined */
		
		// 5.对于数组和对象的元素修改,不算对常量的修改   不会报错
		const tean = ['uzi','hgr','ming'];
		tean.push('haha');// 常量指向地址没有改变
		console.log(tean);// 不会报错   ["uzi", "hgr", "ming", "haha"]
	</script>
</html>